﻿@{
    ViewBag.Title = "OrderManagement";
    bool CanGoBills = (bool)ViewBag.CanGoBills;
    bool isOpenStore=(bool)ViewBag.IsOpenStore;
    var storeList = ViewBag.StoreList as List<Himall.DTO.ShopBranch>;
}
@model IEnumerable<Himall.Model.PaymentType>
<object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width="0" height="0"><embed class="hide" id="LODOP_EM" type="application/x-print-lodop" width="0" height="0" pluginspage="install_lodop32.exe"></embed></object>
<script src="~/Scripts/jquery.HimallDatagrid.js"></script>
<script src="~/Scripts/jquery.HimallLinkage.nocreate.js"></script>
<script src="~/Scripts/jquery.placeholder.min.js"></script>
<script src="~/Scripts/bootstrap.autocomplete.js"></script>
<link rel="stylesheet" type="text/css" href="~/Content/bootstrap-datetimepicker.min.css">
<script type="text/javascript" src="~/Scripts/bootstrap-datetimepicker.js"></script>
<script type="text/javascript" src="~/Scripts/bootstrap-datetimepicker.zh-CN.js"></script>
<script src="~/Scripts/LodopFuncs.js"></script>
<script src="~/Areas/SellerAdmin/Scripts/orderManagement.js"></script>
<script src="~/Scripts/jquery.Himall.Region.js"></script>
<style>
    .dialog-form .input-sm {
        width: auto;
    }
    #area-selector-store select {
    margin-left:5px;
    }
</style>
<div class="container">
    <ul class="nav nav-tabs-custom clearfix">
        <li value="0" type="statusTab"><a>所有订单</a></li>
        <li value="1" type="statusTab"><a>待付款</a></li>
        <li value="2" type="statusTab"><a>待发货</a></li>
        <li value="6" type="statusTab"><a>待自提</a></li>
        <li value="3" type="statusTab"><a>待收货</a></li>
        <li value="5" type="statusTab"><a>交易完成</a></li>
        <li value="4" type="statusTab"><a>已关闭</a></li>
    </ul>
    @if (CanGoBills)
    {
        <button type="button" class="btn-export" id="bt_orderprint" style="position: absolute; right: 10px; margin-top: -35px;">电子面单</button>
    }
    <div class="search-box" id="search-box">
        <form class="form-inline custom-inline">
            <div class="form-group">
                <label class="label-inline w75" for="">订单号</label>
                <input class="form-control input-ssm input-number" type="text" id="txtOrderId">
            </div>
            <div class="form-group">
                <label class="label-inline w75" for="">手机号码</label>
                <input class="form-control input-ssm input-number" type="text" id="txtUserContact">
            </div>
            <div class="form-group">
                <label class="label-inline w75" for="">买家</label>
                <input class="form-control input-ssm" type="text" id="txtUserName">
            </div>
            @if (isOpenStore)
            {
            <div class="form-group">
                <label class="label-inline w75" for="">门店名称</label>
                <select id="shopBranchId" class="form-control input-ssm">
                    <option>全部</option>
                    <option value="0">总店</option>
                    @foreach (var item in storeList)
                    {
                        <option value="@item.Id">@item.ShopBranchName</option>
                    }
                </select>
            </div>
            }
        
            <div class="form-group">
                <label class="label-inline w75" for="">订单日期</label>
                <input id="inputStartDate" class="form-control input-ssm start_datetime" type="text">
                <label class="label-inline-line" for="">-</label>
                <input id="inputEndDate" class="form-control input-ssm end_datetime" type="text">
            </div>
            @if (isOpenStore)
            {
            <div class="form-group">
                <label class="label-inline w75" for="">门店配送</label>
                <select class="form-control input-ssm"  id="allotStore">
                    <option value="0">全部</option>
                    <option value="1">订单已分配门店</option>
                    <option value="2">订单未分配门店</option>
                </select>
            </div>
            }
            @*<div class="form-group">
                    <label class="label-inline w75" for="txtUserContact">联系方式</label>
                    <input class="form-control input-ssm" type="text" id="txtUserContact">
                </div>*@
            <div class="form-group">
                <button type="button" class="btn btn-primary btn-sm" id="searchButton">搜 索</button>
            </div>
        </form>
    </div>

    <table id="list" class="table Sclear-G1 has-bg-table"></table>

    <div class="table-head-l">
        @*<span class="th1" style="padding:4px 15px 4px 10px;"><input type="checkbox" /><label>全选</label></span>*@
        <div class="tabel-operate" id="orderOperate">
            <a onclick="downloadOrderList()" href="#" class="btn btn-default btn-ssm">订单配货表</a>
            <a onclick="myPreview()" class="btn btn-default btn-ssm">打印发货单</a>
            <a onclick="printOrders()" class="btn btn-default btn-ssm">打印快递单</a>
            <a onclick="sendGood()" class="btn btn-default btn-ssm">批量发货</a>
            <a class=" btn btn-default btn-ssm" id="aExport" href='javascript:;' onclick="ExportExecl();">导出查询结果</a>
        </div>
        <div id="prepareGoods">
            <div class="pregoods-btn">
                <a onclick="exportOrderList()" id="orderPrepareGoods" class="btn btn-primary btn-sm">订单配货单</a>
                <a onclick="exportOrderProductList()" id="productPrepareGoods" class="btn btn-primary btn-sm">商品配货单</a>
            </div>
            <div class="pregoods-tags">
                <p>导出内容只包括等待发货状态的订单</p>
                <p>订单配货表不会合并相同的商品，商品配货表则会合并相同的商品。</p>
            </div>
        </div>
        <span class="th3 hide">
            <label>每页显示</label>
            <select class="form-control input-ssm">
                <option value="">10</option>
                <option value="">20</option>
                <option value="">50</option>
                <option value="">100</option>
                <option value="">200</option>
            </select>
        </span>
    </div>
</div>
<input type="hidden" value="@Request.QueryString["status"]" id="RQS" />
<div class="dialog-form" id="remark-form" style="display:none">
    <div class="form-group">
        <span class="sign-t"><i class="red">*</i>&nbsp;&nbsp;标注：</span>
        <input type="radio" name="radflag" value="1" checked /><i class="iconfont f01">&#xe630;</i>
        <input type="radio" name="radflag" value="2" /><i class="iconfont f02">&#xe630;</i>
        <input type="radio" name="radflag" value="3" /><i class="iconfont f03">&#xe630;</i>
        <input type="radio" name="radflag" value="4" /><i class="iconfont f04">&#xe630;</i>

    </div>

    <div class="form-group">
        @*<p class="help-top pl0">请填写您的备注内容</p>*@
        <textarea id="remarkContent" name="remarkContent" class="form-control" cols="60" rows="3" placeholder="最多可输入200个字" style="width:100%"></textarea>
        <br />
        <span class="field-validation-error" style="display:none" id="remarkContentTip">回复内容在200个字符以内！</span>
    </div>
</div>
<div id="storeSelect-form" style="display:none;">
    <div class="dialog-form">
        <div class="form-group">
            <label for="" class="label-inline" style="width: 90px !important;">收货地址</label>
            <span id="shippingAddresses"></span>
        </div>
        <div class="form-group">
            <label class="label-inline" for="" style="width: 90px !important;">选择门店</label>
            <span id="area-selector-store"></span>
        </div>
        <div class="form-group">
            <label class="col-sm-3" for="" style="width:129px;"></label>
            <select id="ddlStores" class="form-control input-sm"><option value='0'>请选择门店</option></select>
            @Html.Hidden("StoreAddressId")
            <font id="storeHelper" style="color:red"></font>
        </div>
    </div>
</div>
@Html.Hidden("isOpenStore", isOpenStore)